using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using MCMLXVII.BackEnd.Services.Common.Messages;
using MCMLXVII.BackEnd.Services.SystemConfiguration.Messages;
using MCMLXVII.Core.Common.BackEnd;
using MCMLXVII.Core.Common.BackEnd.ConfigurationClasses;
using MCMLXVII.BackEnd.Pipeline;
using System.ServiceModel;

namespace MCMLXVII.BackEnd.Services.Core.BusinessActions
{
    public class Bindings
    {

        public msgBindingInfo[] GetHandlersList(msgGenericItemRequest<string> PartitionName)
        {
            //xmlSerializableGenericCollection<BindingConfig> cfg = PartitionsManager.GetHandlers(PartitionName.Item);
            //msgBindingInfo[] res = new msgBindingInfo[cfg.Count];
            //int i = 0;
            //foreach (DictionaryEntry de in cfg.GetItems())
            //{
            //    BindingConfig hc = (BindingConfig)de.Value;
            //    StringNameAndValue[] inf = new StringNameAndValue[hc.Config.GetItems().Count];
            //    int j = 0;
            //    foreach(DictionaryEntry desub in hc.Config.GetItems())
            //    {
            //        inf[j] = new StringNameAndValue(desub.Key.ToString(), desub.Value.ToString());
            //        j++;
            //    }
            //    res[i] = new msgBindingInfo(hc.Name, hc.HType, (int)hc.ActivationMode, inf);
            //    i++;
            //}
            //return res;
            throw new FaultException<BackendFault>(new BackendFault(BackendFaulType.Technical, "Not Implemented yet"));


        }


        public msgBindingInfo GetBindingInfo(msgPartitionItemRequest req)
        {
            //BindingConfig cfg = PartitionsManager.GetHandler(req.PartitionName, req.ItemName);
            //StringNameAndValue[] inf = new StringNameAndValue[cfg.Config.GetItems().Count];
            //int j = 0;
            //foreach (DictionaryEntry desub in cfg.Config.GetItems())
            //{
            //        inf[j] = new StringNameAndValue(desub.Key.ToString(), desub.Value.ToString());
            //        j++;
            //}
            //return new msgHandlerInfo(cfg.Name, cfg.HType, (int)cfg.ActivationMode, inf);
            throw new FaultException<BackendFault>(new BackendFault(BackendFaulType.Technical, "Not Implemented yet"));        }

    }
}
